package bb.lanxing.service;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import bb.lanxing.calc.data.DisplayPoint;

public interface IWorkoutRemoteService extends IInterface {
    void closeBLE() throws RemoteException;

    void flushLocation() throws RemoteException;

    DisplayPoint getBiciDisplayPoint() throws RemoteException;

    DisplayPoint getDisplayPoint() throws RemoteException;

    boolean isServiceRunning() throws RemoteException;

    boolean isSporting() throws RemoteException;

    void openBLE() throws RemoteException;

    void startSport(long j) throws RemoteException;

    void stopSport() throws RemoteException;

    void pauseSportByUser(boolean pause) throws RemoteException;

    public static abstract class Stub extends Binder implements IWorkoutRemoteService {
        private static final String DESCRIPTOR = "bb.lanxing.service.IWorkoutRemoteService";
        static final int TRANSACTION_isServiceRunning = 1;
        static final int TRANSACTION_getDisplayPoint = 2;
        static final int TRANSACTION_getBiciDisplayPoint = 3;
        static final int TRANSACTION_flushLocation = 4;
        static final int TRANSACTION_startSport = 5;
        static final int TRANSACTION_stopSport = 6;
        static final int TRANSACTION_isSporting = 7;
        static final int TRANSACTION_openBLE = 8;
        static final int TRANSACTION_closeBLE = 9;
        static final int TRANSACTION_pauseSportByUser = 10;

        @Override
        public IBinder asBinder() {
            return this;
        }

        public Stub() {
            attachInterface(this, DESCRIPTOR);
        }

        public static IWorkoutRemoteService asInterface(IBinder iBinder) {
            if (iBinder == null) {
                return null;
            }
            IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
            if ((queryLocalInterface instanceof IWorkoutRemoteService)) {
                return (IWorkoutRemoteService) queryLocalInterface;
            }
            return new Proxy(iBinder);
        }

        @Override
        public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
            if (i == INTERFACE_TRANSACTION) {
                parcel2.writeString(DESCRIPTOR);
                return true;
            }
            switch (i) {
                case TRANSACTION_isServiceRunning -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    boolean isServiceRunning = isServiceRunning();
                    parcel2.writeNoException();
                    parcel2.writeInt(isServiceRunning ? 1 : 0);
                    return true;
                }
                case TRANSACTION_getDisplayPoint -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    DisplayPoint displayPoint = getDisplayPoint();
                    parcel2.writeNoException();
                    if (displayPoint != null) {
                        parcel2.writeInt(1);
                        displayPoint.writeToParcel(parcel2, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
                    } else {
                        parcel2.writeInt(0);
                    }
                    return true;
                }
                case TRANSACTION_getBiciDisplayPoint -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    DisplayPoint biciDisplayPoint = getBiciDisplayPoint();
                    parcel2.writeNoException();
                    if (biciDisplayPoint != null) {
                        parcel2.writeInt(1);
                        biciDisplayPoint.writeToParcel(parcel2, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
                    } else {
                        parcel2.writeInt(0);
                    }
                    return true;
                }
                case TRANSACTION_flushLocation -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    flushLocation();
                    parcel2.writeNoException();
                    return true;
                }
                case TRANSACTION_startSport -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    startSport(parcel.readLong());
                    parcel2.writeNoException();
                    return true;
                }
                case TRANSACTION_stopSport -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    stopSport();
                    parcel2.writeNoException();
                    return true;
                }
                case TRANSACTION_isSporting -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    boolean isSporting = isSporting();
                    parcel2.writeNoException();
                    parcel2.writeInt(isSporting ? 1 : 0);
                    return true;
                }
                case TRANSACTION_openBLE -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    openBLE();
                    parcel2.writeNoException();
                    return true;
                }
                case TRANSACTION_closeBLE -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    closeBLE();
                    parcel2.writeNoException();
                    return true;
                }

                case TRANSACTION_pauseSportByUser -> {
                    parcel.enforceInterface(DESCRIPTOR);
                    pauseSportByUser(parcel.readInt() != 0);
                    parcel2.writeNoException();
                    return true;
                }
                default -> {
                    return super.onTransact(i, parcel, parcel2, i2);
                }
            }
        }

        public static class Proxy implements IWorkoutRemoteService {
            public static IWorkoutRemoteService sDefaultImpl;
            private IBinder mRemote;

            Proxy(IBinder iBinder) {
                this.mRemote = iBinder;
            }

            @Override
            public IBinder asBinder() {
                return this.mRemote;
            }

            @Override
            public boolean isServiceRunning() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    boolean z = false;
                    if (!this.mRemote.transact(TRANSACTION_isServiceRunning, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().isServiceRunning();
                    }
                    obtain2.readException();
                    if (obtain2.readInt() != 0) {
                        z = true;
                    }
                    return z;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public DisplayPoint getDisplayPoint() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_getDisplayPoint, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().getDisplayPoint();
                    }
                    obtain2.readException();
                    return obtain2.readInt() != 0 ? DisplayPoint.CREATOR.createFromParcel(obtain2) : null;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public DisplayPoint getBiciDisplayPoint() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_getBiciDisplayPoint, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().getBiciDisplayPoint();
                    }
                    obtain2.readException();
                    return obtain2.readInt() != 0 ? DisplayPoint.CREATOR.createFromParcel(obtain2) : null;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void flushLocation() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_flushLocation, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().flushLocation();
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void startSport(long j) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    obtain.writeLong(j);
                    if (!this.mRemote.transact(TRANSACTION_startSport, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().startSport(j);
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void stopSport() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_stopSport, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().stopSport();
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public boolean isSporting() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    boolean z = false;
                    if (!this.mRemote.transact(TRANSACTION_isSporting, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().isSporting();
                    }
                    obtain2.readException();
                    if (obtain2.readInt() != 0) {
                        z = true;
                    }
                    return z;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void openBLE() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_openBLE, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().openBLE();
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void closeBLE() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_closeBLE, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().closeBLE();
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void pauseSportByUser(boolean pause) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    obtain.writeInt(pause ? 1 : 0);
                    if (!this.mRemote.transact(TRANSACTION_pauseSportByUser, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().pauseSportByUser(pause);
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }
        }

        public static IWorkoutRemoteService getDefaultImpl() {
            return Proxy.sDefaultImpl;
        }
    }
}